<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 600px;
            height: 600px;
            background-color: pink;
            /* 
                grid布局是一种网格布局
            */
            display: grid;
            grid-template-columns: repeat(3,100px);
            grid-template-rows: repeat(3,100px);
            /* 
               justify-items: center;每个单元格的水平位置
                align-items: center; 每个单元格的垂直位置(上中下)
                值：stretch拉伸/start/center/end

                place-items:垂直 水平;两种属性的综合写法
            */
            /* justify-items: center;
            align-items: center; */
            /* place-items: start center; */

            /* 
                justify-content:整个内容在容器里的水平位置
                align-content：整个内容在容器里的垂直位置
                值：start center end space-around space-bewteen space-evenly

                  place-content: center center;综合写法
            */
            place-content: center center;
        }
        .item{
            background-color: skyblue;
            border: 1px solid aqua;
        }
        .item:nth-child(1){
            /* 
                作用给子元素：
                 justify-self: start;设置单个网格内容的水平位置
                align-self: end;设置单个网格内容的垂直位置(上中下)
                值：stretch拉伸/start/center/end


                place-self：综合写法
            */
            justify-self: start;
            align-self: end;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        <div class="item">7</div>
        <div class="item">8</div>
        <div class="item">9</div>
    </div>
</body>
</html>